package com.zretc.service.impl;

import com.zretc.dao.FindDateMapper;
import com.zretc.service.FindDateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class FindDateServiceImpl implements FindDateService {

    private static final Logger logger = LoggerFactory.getLogger(FindDateServiceImpl.class);

    @Autowired
    private FindDateMapper mapper;

    @Override
    public Map<Integer, Object> findWeekByWeek(Integer month) {
        Map<Integer, Object> map = new HashMap<>();
        Object n = 0;
        for (int i = 0; i < 7; i++){
            n = mapper.findWeekByWeek(i, month);
            logger.info("============"+n);
            if (n != null){
                map.put(i, n);
            }

        }

        return map;
    }
}
